package chen.web.forum;

import java.util.Date;

import chen.web.cache.CacheFactory;
import chen.web.user.Account;

public class TopicInfo{

	private int id;
	private String title;
	private Category category;
	private int viewCount;
	private int replyCount;
	private String ip;		//ip
	private Date lastReplyDate;
	private String lastReplierNickname;
	private int lastReplierId;
	private int authorId;
	private String authorNickame;
	private boolean digest;
	private boolean top;
	private int flag;
	private int widgetType;
	
	public Account getAuthorInCache(){
		 return CacheFactory.getCache(CacheFactory.ID_Account, Integer.class, Account.class).get(authorId);
	}
	
	public Account getLastReplierInCache(){
		return CacheFactory.getCache(CacheFactory.ID_Account, Integer.class, Account.class).get(lastReplierId);
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public int getViewCount() {
		return viewCount;
	}
	public void setViewCount(int viewCount) {
		this.viewCount = viewCount;
	}
	public int getReplyCount() {
		return replyCount;
	}
	public void setReplyCount(int replyCount) {
		this.replyCount = replyCount;
	}
	public Date getLastReplyDate() {
		return lastReplyDate;
	}
	public void setLastReplyDate(Date lastReplyDate) {
		this.lastReplyDate = lastReplyDate;
	}
	public String getLastReplierNickname() {
		return lastReplierNickname;
	}
	public void setLastReplierNickname(String lastReplierNickname) {
		this.lastReplierNickname = lastReplierNickname;
	}
	public int getAuthorId() {
		return authorId;
	}
	public void setAuthorId(int authorId) {
		this.authorId = authorId;
	}
	public String getAuthorNickame() {
		return authorNickame;
	}
	public void setAuthorNickame(String authorNickame) {
		this.authorNickame = authorNickame;
	}

	public void setDigest(boolean digest) {
		this.digest = digest;
	}

	public boolean isDigest() {
		return digest;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getIp() {
		return ip;
	}

	public void setTop(boolean top) {
		this.top = top;
	}

	public boolean isTop() {
		return top;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	public int getFlag() {
		return flag;
	}
	public int getLastReplierId() {
		return lastReplierId;
	}

	public void setLastReplierId(int lastReplierId) {
		this.lastReplierId = lastReplierId;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public Category getCategory() {
		return category;
	}

	public void setWidgetType(int widgetType) {
		this.widgetType = widgetType;
	}

	public int getWidgetType() {
		return widgetType;
	}
}
